package com.example.petshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.petshop.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    List<Order> getAll();

    List<Order> selectOrdersByIds(List<Integer> ids);

    Order findById(Integer orderId);

    int updateById(Order order);

//    List<Order> getByState(String state);

//    List<Order> findByUserIdAndState(Long userId, String state);
List<Order> findByUserIdAndState(@Param("userId") Long userId, @Param("orderState") String orderState);

    void updateOrder(Order order);


    void saveReamark(Order order);

    void saveReason(Order order);

    List<Order> findByUserIdAndOrderStateIn(@Param("userId")Long userId,  @Param("states")List<String> states);



    List<Order> findRemarksByGoodsName(String goodsName);

    List<Order> findByShopId(int shopId);
}
